import request from '@/utils/request'

// 查询商品列表
export function listGood (query) {
  return request({
    url: '/system/good/list',
    method: 'get',
    params: query
  })
}

// 查询商品详细
export function getGood (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/good/getInfo',
    method: 'get',
    params: params
  })
}

// 新增商品
export function addGood (data) {
  return request({
    url: '/system/good/insert',
    method: 'post',
    data: data
  })
}

// 修改商品
export function updateGood (data) {
  return request({
    url: '/system/good/update',
    method: 'post',
    data: data
  })
}

// 删除商品
export function delGood (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/good/delete',
    method: 'post',
    params: params
  })
}
// 批量删除商品
export function delBatchGood (ids) {
  const params = {
    'ids': ids
  }
  return request({
    url: '/system/good/deleteBatch',
    method: 'post',
    params: params
  })
}

// 导入商品
export function importData (data) {
  return request({
    url: '/system/good/importData',
    method: 'post',
    data: data
  })
}
